<?php
class graphics {
        function graphics() {

        }

        function generateValidationImage($rand) {
                $width = 80;
                $height = 40;
		$image= imagecreatefromjpeg("captcha.jpg");
                $bgColor = imagecolorallocate ($image, 255, 255, 255);
                $textColor = imagecolorallocatealpha ($image,220,194,195,0);
                imagestring($image, 5, 15,6 , $rand, $textColor);
                header("Expires: Mon, 23 Jul 1993 05:00:00 GMT");
                header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
                header("Cache-Control: no-store, no-cache, must-revalidate");
                header("Cache-Control: post-check=0, pre-check=0", false);
                header("Pragma: no-cache");
                header('Content-type: image/jpeg');
                imagejpeg($image);
                imagedestroy($image);
        }
}
?>
